package com.weipai.education.dao.impl;

import com.weipai.education.dao.RoleDao;
import com.weipai.education.mapper.RoleMapper;
import com.weipai.education.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/11 15:24
 */
@Repository
public class RoleDaoImpl implements RoleDao {
    
    @Autowired
    private RoleMapper roleMapper;
    
    @Override
    public List<Map<String, Object>> list(String status) {
        return roleMapper.list(status);
    }

    @Override
    public int update(Role role) {
        return roleMapper.updateByPrimaryKeySelective(role);
    }

    @Override
    public int insert(Role role) {
        return roleMapper.insert(role);
    }

    @Override
    public int deleteById(String id) {
        return roleMapper.deleteByPrimaryKey(Integer.parseInt(id));
    }

    @Override
    public Role selectByPrimaryKey(String id) {
        return roleMapper.selectByPrimaryKey(Integer.parseInt(id));
    }

    @Override
    public Role getRoleById(Integer roleId) {
        return null;
    }
    
}
